/*


 */

package jas.rpc.server;

/**
 * Serializes and deserializes objects so they can be printed in an HTTP message
 * to another machine.
 */
public interface ObjectServerSerializer {
	/**
	 * Instanciates a server-side object from a text encoding.
	 * @param s text encoding of the boject
	 * @param ids bank used to translate object identifiers to existing Java objects
	 * @return the instanciated object
	 * @throws ClassNotFoundException if the encoded object was of a class not available on this machine.
	 */
    Object deserializeObject(String s, ObjectIdBank ids) throws ClassNotFoundException;
    
    /**
     * Creates a text encoding of an object, so it can be sent in an HTTP message.
     * @param o object to encode
     * @param ids bank used to translate server-side Java objects to object identifiers
     * @return the text encoding of the object
     */
    String serializeObject(Object o, ObjectIdBank ids);
}
